package org.moonlight.jvm.natives.java.lang.doubles;

import org.moonlight.jvm.natives.AbstractNativeMethod;
import org.moonlight.jvm.rtda.exclusive.Frame;

/**
 * java.lang.Double public static native long doubleToRawLongBits(double value);
 *
 * @author Moonlight
 * @createTime 2023/9/22 16:12
 **/
public class DoubleToRawLongBits extends AbstractNativeMethod {

    public DoubleToRawLongBits() {
        super("java/lang/Double", "doubleToRawLongBits", "(D)J");
    }

    @Override
    public void nativeMethod(Frame frame) {
        double val = frame.getLocalVars().getDouble(0);
        long bits = Double.doubleToRawLongBits(val);
        frame.getOperandStack().pushLong(bits);
    }

}
